from rest_framework import serializers
from course import models


class CategorySer(serializers.ModelSerializer):
    class Meta:
        model=models.Category
        fields=["id","cname"]


class CategorySerializer(serializers.ModelSerializer):
    children=CategorySer(many=True)
    class Meta:
        model=models.Category
        fields="__all__"